﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ElectrosLtd.Models
{
    public class FaultModel
    {
        [Required(ErrorMessage = "Username cannot be left empty")]
        public string Username { get; set; }

        [Required(ErrorMessage = "Password cannot be left empty")]
        public string Password { get; set; }

        [Required(ErrorMessage = "PIN cannot be left empty")]
        public int PIN { get; set; }

        public int ProductID { get; set; }

        [Required(ErrorMessage="The fault detail(s) must be listed")]
        public string Details { get; set; }

        public int CategoryID { get; set; }
        public SelectList CategoryList { get; set; }

        public FaultModel()
        {
            CategoryList = new SelectList(new ProductsServ.WCFProductsClient().GetCategories(), "ID", "Name");
            
        }
    }
}